using System;
using UnityEngine;

public class Action1008 : GameAction {
    private ActionResult actionResult;

    public Action1008 ( )
        : base(1008) {
    }

    protected override void SendParameter (NetWriter writer, ActionParam actionParam) {

    }

    protected override void DecodePackage (NetReader reader) {
        actionResult = new ActionResult( );
        actionResult["Pid"] = reader.readString( );
        actionResult["HeadIcon"] = reader.readString( );
        actionResult["NickName"] = reader.readString( );
        actionResult["GameCoin"] = reader.getInt( );
        actionResult["Gold"] = reader.getInt( );
        actionResult["VipLv"] = reader.getInt( );
        actionResult["WinNum"] = reader.getInt( );
        actionResult["FailNum"] = reader.getInt( );
        actionResult["TitleName"] = reader.readString( );
        actionResult["ScoreNum"] = reader.getInt( );
        actionResult["WinRate"] = reader.getInt( );

        int subRecordCount = reader.getInt( );
        var subTable = new ActionResult[subRecordCount];
        for (int i = 0; i < subRecordCount; i++) {
            var subRecord = new ActionResult( );
            reader.recordBegin( );
            subRecord["RoomId"] = reader.getInt( );
            subRecord["RoomName"] = reader.readString( );
            subRecord["RoomMultiple"] = reader.getShort( );     //reader.getWORD( );
            subRecord["MinCion"] = reader.getInt( );
            subRecord["GiffCion"] = reader.getInt( );
            subRecord["Description"] = reader.readString( );
            subRecord["AnteNum"] = reader.getInt( );
            reader.recordEnd( );
            subTable[i] = subRecord;
        }
        actionResult["Children_1"] = subTable;
        actionResult["RoomId"] = reader.getInt( );

    }

    public override ActionResult GetResponseData ( ) {
        return actionResult;
    }
}
